<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            text-align: center;
        }
        div{
            margin: 60px auto;
        }
    </style>
</head>
<body>
<div>
    <p>
        支付成功！
    </p>
    <p>
        <span id="num">5</span>秒后自动跳转。
    </p>
</div>
</body>
<script>
    var n = 5;
    function show() {
        var num = document.getElementById("num");
        num.innerHTML=n--;
        if (n==-1){
            clearInterval(f);
            // location.href="msg_goumai.html"
            history.back();


        }

    }
    var f = setInterval(show,1000);
    // show();
</script>
</html>